package com.group3.Feign;


import com.group3.common.result.ApiResponse;
import com.group3.config.FeignConfiguration;
import com.group3.fallback.order.OrderServiceFallback;
import com.group3.model.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@FeignClient(value="ls-service-order",
        configuration = FeignConfiguration.class,
fallback =  OrderServiceFallback.class)
public interface OrderServiceFeign {
    // 添加OrderController对应的远程调用方法
    @PostMapping("/order/add")
    ApiResponse addOrder(@RequestParam("uid") Integer uid, @RequestParam("pid") Integer pid);

    @GetMapping("/order/getOrderListbyUid/{uid}")
    List<Order> getOrderListbyUid(@PathVariable Integer uid);

    @GetMapping("/order/getOrderByOid/{id}")
    Order getOrderByOid(@PathVariable Integer id);

    @PostMapping("/order/updateOrder")
    boolean updateOrder(@RequestBody Order order);
    @GetMapping("/mq/sendpayOrder/{oid}")
    ApiResponse payOrder(@PathVariable Integer oid);
}